package com.lc1993929.chapter21;

/**
 * Created by LiuChang on 2018/9/21.
 */
public abstract class IntGenerator {
    private volatile boolean canceled = false;

    public abstract int next();

    //    Allow this to be canceled;
    public void canceled() {
        canceled = true;
    }

    public boolean isCanceled() {
        return canceled;
    }
}
